
package com.wsj.message_server.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@ApiModel(value = "基础返回类", description = "基础返回类")
@Data
public class FFResponse<T> implements Serializable {

    private static final long serialVersionUID = 1L;
    // 状态码
    @ApiModelProperty(notes = "业务码： 200 - 正常， -1 - 查询无数据 ， 401 - 未授权 ， 400 - 签名错误 ，500 - 服务器错误", example = "1")
    private int code;
    // 业务提示语
    @ApiModelProperty(notes = "业务描述", example = "操作成功")
    private String msg;

    @ApiModelProperty(notes = "是否有更多数据", example = "true")
    private boolean hasMore;

    @ApiModelProperty(notes = "总记录数", example = "10000")
    private int totalCount;

    // 数据对象
    private T data;

    public FFResponse(int code, String msg, T data , boolean hasMore, int totalCount) {
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.hasMore = hasMore;
        this.totalCount = totalCount;
    }
}
